This invention relates to digital cameras, and more particularly for color enhancement of a digital image.
Family photos in color replaced earlier black-and-white photographs in the 1960""s. More recently, digital cameras are replacing traditional film cameras. Digital cameras are being improved and lowered in cost at a rapid pace. Images from digital cameras can be downloaded and stored on personal computers. Digital pictures can be converted to common formats such as JPEG and sent as e-mail attachments or posted to virtual photo albums on the Internet. Video as well as still images can be captured, depending on the kind of digital camera.
Bright, rich colors in pictures are still preferred, even for digital pictures. Color enhancement can be applied to digital pictures as it has been applied in wet photofinishing processes for traditional cameras. For digital pictures, each picture dot (pixel) is originally represented by numeric values of red, green, and blue (RGB). Each RGB pixel can be converted to the YUV format, where the Y luminance component represents the overall brightness while the U and V components represent the color.
The color of a pixel can be enhanced or exaggerated by increasing the color components U or V of a pixel.
FIG. 1 is a block diagram for a typical digital camera. Light focused through a lens is directed toward sensor 12, which can be a charge-coupled device (CCD) array or a complementary metal-oxide-semiconductor (CMOS) sensor array. The light falling on the array generates electrical currents, which are amplified by analog amp 14 before being converted from analog to digital values by A/D converter 16. An 8, 9, or 10-bit mono-color pixel is output to processor 10. These mono-color pixels are in a Bayer-pattern. Each pixel is either a red, a blue, or a green intensity.
The R, G, or B digital values in the Bayer pattern are processed by processor 10 to generate luminance-chrominance YUV pixels. The YUV pixels can then be displayed on display 19 or compressed by compressor 18 and stored on disk 17 or on a solid-state memory. YUV pixels often have a 4:4:4 format, with 8 bits for each of 2 colors and for the luminance.
Sensor 12 detects red, blue and green colors. However, each array point in sensor 12 can detect only one of the three primary colors. Rather than outputting an RGB pixel, sensor 12 can output only a single-color pixel at any given time. For example, a line of pixels output by sensor 12 might have a red pixel followed by a green pixel. Another line might have alternating green and blue pixels. Each pixel contains only one-third of the total color information. The remaining color information is obtained by interpolation. Processor 10 performs this color interpolation, calculating the missing primary-color intensities for each pixel location.
Processor 10 also may perform other enhancements to the image. Edges may appear fuzzy because the color interpolation tends to spread out features. These edges can be sharpened by detecting the edges and enhancing the color change at the edge to make the color transition more abrupt. Color conversion from RGB to YUV is also performed by processor 10. Color enhancement can also be performed by processor 10.
The electrical currents produced by the different primary colors can vary, depending on the sensor used and the wavelength and energy of the light photons. An adjustment known as a white-balance is often performed before processor 10, either on analog or digital values. Each primary color can be multiplied by a different gain to better balance the colors. Compensation can also be made for different lighting conditions, increasing all primary colors for dark pictures or decreasing all colors for bright pictures (overexposure).
FIG. 2 illustrates color enhancement of YUV pixels by a constant. The processor 10 of FIG. 1 may perform color enhancement once the RGB pixels are converted to YUV pixels. Enhancer 22 receives a YUV pixel and enhances the U and V color components to generate a color-enhanced pixel YUxe2x80x2Vxe2x80x2.
A constant value S is applied to multipliers 24, 26. Multiplier 24 multiplies the constant scale factor S by the U component to generate the enhanced Uxe2x80x2 component. Multiplier 26 multiplies the constant scale factor S by the V component to generate the enhanced Vxe2x80x2 component. S is typically a constant greater than 1.0.
Since the U and V components are typically in the range of xe2x88x920.5 to +0.5, enhancement by multiplying by the scale factor S increases the absolute value of each color component. This makes the colors appear richer.
However, all pixels in an image are multiplied by the same scale factor S. Even background portions of the image or less-important parts of the image are color enhanced to the same degree. This can sometimes produce an undesirable color saturation effect, where the image is too bright and has too much color in it.
A more preferred method would enhance some pixels, such as pixels in the more important part of a picture, while not enhancing other pixels, such as background pixels. Rather than use the same scale factor for all pixels, an adaptive scale factor that can vary from pixel to pixel is desired.
It is desired to adaptively change the color-enhancement scale factor on a pixel-by-pixel basis. It is desired to use different scale factors within a particular image. It is desired to vary the scale factor depending on the color and brightness of the pixel being enhanced. It is desired to vary the scale factor as a function of the Y, U, and V values of the pixel being color-enhanced. An adaptive color-enhancement function and method is desired.
An adaptive color enhancer has a pixel input that receives a current pixel value. A calculation unit receives the current pixel value from the pixel input. It generates an enhancement factor for the current pixel value. The enhancement factor varies for each pixel with the current pixel value. The enhancement factor is a function of the current pixel value.
An applicator receives the current pixel value from the pixel input. It applies the enhancement factor from the calculation unit to the current pixel value to generate an enhanced pixel value. The enhanced pixel value is output in place of the current pixel value. Thus pixels are color enhanced using the enhancement factor generated from the current pixel value.
In further aspects of the invention the current pixel value includes a color value and an intensity value. The calculation unit includes a first function means for generating an intermediate enhancement factor as a function of the intensity value and a second function means that receives the intermediate enhancement factor. It generates the enhancement factor as a function of the color value and as a function of the intensity value. The applicator applies the enhancement factor to the color value of the current pixel value but does not apply the enhancement factor to the intensity value of the current pixel value. Thus the color value of the current pixel value is enhanced as a function of both the intensity and color values of the current pixel value.
In further aspects the function of the color value produces more color enhancement for color values representing colorful pixels than for color values representing dull pixels. Thus colorful pixels are color-enhanced more than dull pixels. The function of the intensity value produces more color enhancement for intensity values representing bright pixels than for color values representing average-brightness pixels. Thus bright pixels are color-enhanced more than average-brightness pixels.
In still further aspects of the invention the function of the intensity value also produces more color enhancement for intensity values representing dim pixels than for color values representing average-brightness pixels. Thus bright pixels and dim pixels are color-enhanced more than average-brightness pixels.
In other aspects the first function means includes a piece-wise-linear (PWL) means for generating the intermediate enhancement factor as a PWL function of the intensity value and pre-set scale factors. The pre-set scale factors are constant for all pixels in a digital image.
In further aspects of the invention the current pixel value is a YUV value. The intensity value is a Y luminance value and the color value is a combination of U and V chrominance values. Thus the current pixel value is in a YUV format.
In further aspects the calculation unit further includes first absolute means for generating a U absolute value of a U value of the current pixel value and second absolute means for generating a V absolute value of a V value of the current pixel value. An adder means adds the U absolute value and the V absolute value to generate the color value. The color value numerically represents an overall colorfulness of the current pixel value. Thus U and V color values are combined.